home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr55 / lxfaq160.zip / LINUXFAQ.06 < prev   
Internet Message Format  |  1993-06-09  |  62KB

  1. From getrz!chsun!mcsun!news.funet.fi!hydra!klaava!wirzeniu Wed Jun  9 14:02:53 1993
  2. Xref: getrz comp.os.linux:16159 news.answers:3008
  3. Newsgroups: comp.os.linux,comp.os.linux.announce,comp.answers,news.answers
  4. Path: getrz!chsun!mcsun!news.funet.fi!hydra!klaava!wirzeniu
  5. From: corsini@victor.greco-prog.fr
  6. Subject: Linux Frequently Asked Questions 5/5 [monthly posted]
  7. Message-ID: <1993Jun8.144528.18868@klaava.Helsinki.FI>
  8. Followup-To: poster
  9. Summary: Linux, a small and free unix-like for 386-AT computers.
  10. Sender: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
  11. Reply-To: linux@numero6.greco-prog.fr
  12. Organization: Greco Prog. CNRS & LaBRI, Bordeaux France
  13. Date: Tue, 8 Jun 1993 14:45:28 GMT
  14. Approved: linux-announce@tc.cornell.edu (Lars Wirzenius)
  15. Expires: Wed, 21 Jul 1993 13:49:58 GMT
  16. Lines: 1661
  17.  
  18. Archive-name: linux-faq/part5
  19. Last-Modified: 93/06/07
  20. Version: 1.18
  21.  
  22. *********************************************************
  23. *                            *
  24. *   Answers to Frequently asked questions about Linux   *
  25. *                            *
  26. *********************************************************
  27.  
  28. This post contains Part 5 of the Linux FAQ (5 parts).
  29. It must be read *after* the 4 first parts. 
  30.  
  31. ===================================8<====>8============================
  32. CONTENTS (of this part)
  33.  
  34.     XII.    X11, THE MAXIMUM and MORE    (part5)
  35.     XIII.    NETWORKING and LINUX        (part5)
  36.     XIV.    EVERYTHING FOR PRINTING        (part5)
  37.  
  38. ===================================8<====>8============================
  39.  
  40.  
  41.  
  42. XII. X11 THE MAXIMUM and MORE
  43. =============================
  44. *** This section is maintained by Krishna Balasubramanian
  45. *** <balasub@cis.ohio-state.edu>. Mail him if you have corrections,
  46. *** additions, etc.
  47. *** Last update:  Thu, 13 May 93 00:35:45 -0400
  48.  
  49.  
  50. XII.A. X386 GENERAL INFORMATION
  51. XII.B. HARDWARE REQUIREMENTS: Supported Video cards, mice.
  52.  
  53. XII.C. LINUX DISTRIBUTION: Files required, Current version.
  54. XII.D. LEARNING/USING X: Pointers to X documentation.
  55.  
  56. XII.E. DEBUGGING STARTUP PROBLEMS: Checklist, Screen restoration, Hanging.
  57. XII.F. XCONFIG: Video mode settings and common errors in Xconfig.
  58.  
  59. XII.G. X-APPLICATIONS: Compiling X programs.
  60. XII.H. ATI: SVGA server for ATI boards.
  61.  
  62. XII.I. BUGS
  63.  
  64.  
  65. The X11 directories on linux systems are:
  66. XLIB = /usr/X386/lib/X11/      (or /usr/lib/X11/) 
  67. XBIN = /usr/X386/bin/          (or /usr/bin/X11/)
  68. XDOC = XLIB/etc/
  69.  
  70. cwxi = the comp.windows.x.i386unix newsgroup
  71. Subscribe to this group if you are an xfree86 user. Post general
  72. questions on xfree86 to cwxi instead of c.o.l. Very few problems
  73. with using xfree86 are Linux specific.
  74.  
  75.  
  76.  
  77. XII.A. X386 GENERAL INFORMATION
  78. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  79.  
  80.  XII.01)  What is the X11 release supported by Linux?
  81.  
  82. ANSWER: It's the X11R5 (xfree86-1.2). 
  83.     There are (currently separate) servers for 8514 and S3 chips.
  84.  
  85. xfree86-1.3 should be available in a few weeks. Major changes are
  86. Improvement of video restoration, expanded support for WD chips
  87. and the inclusion of PEX. You should get newer versions of any
  88. applications that are older than the xfree86-1.2 release.
  89.  
  90.  XII.02)  What is X386/xfree86?
  91.  
  92. ANSWER: X386 is the port of the X11 server to System V/386 that was
  93. done by Thomas Roell (roell@informatik.tu-muenchen.de).  It supports a
  94. wide variety of VGA boards.  X386 1.2 is included in MIT's X11R5
  95. distribution.
  96.  
  97. The Linux X386 port was based on the stock distribution from X11R5,
  98. from MIT and was done by Orest Zborowski (obz@sisd.kodak.com).
  99.  
  100. It has since moved to becoming part of the standard xfree86 distribution.
  101. See the FAQ on cwxi for more information on xfree86.
  102.  
  103.  XII.03)  Where can I get X386 1.2 (X11R5)?
  104.  
  105. ANSWER: The X386 1.2 and xfree86 sources are available at any site that
  106. distributes the X11R5 source (too numerous to list here, but includes
  107. export.lcs.mit.edu)
  108.  
  109.  
  110.  XII.04)  Any tips on compiling X11R5?
  111.  
  112. ANSWER:
  113. -  Dont do it.
  114. -  XFree86 is distributed with a link kit so you can optionally
  115.     include what you like in the server.
  116. -  Join the xfree86 beta team (how to? see cwxi FAQ)
  117. -  Instructions are in the README file in XDOC/ and the cwxi FAQ.
  118.  
  119.  
  120.  
  121. XII.B  HARDWARE REQUIREMENTS:
  122. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  123. Approx: at least 4 megs of ram + swap ...slooooww. 10 Meg disk for X.
  124. Another 6-10 meg of disk for GCC if you want to compile X11 programs.
  125.  
  126.  XII.05)  What VGA boards are supported?
  127.  
  128. ANSWER: 
  129.     et3000, et4000, gvga, pvga1a, wd890c00, tvga8900, ati ver. 5 or 6,
  130.         8514/A. (X386mono supports generic vga's and hercules).
  131.  
  132.     Diamond cards are not supported and will not be supported. If
  133.     you are the unfortunate owner of such a card, you can probably 
  134.     get the server up by booting in specific modes or using dos to 
  135.     set your modes before warm booting into linux or using an 
  136.     external clock setting program. You will have to bear with these 
  137.     irks until you can convince diamond to alter their policy.
  138.  
  139.     Standard x11v1.1 or xfree86 server:
  140.     ET3000         (for ex. GENOA 5300/5400)
  141.         ET4000         (Tricom, STB PWR Graph, Sigma Legend, etc.)
  142.         GVGA         (Genoa 6400)
  143.         PVGA1A         (Paradise VGA Professional) 
  144.         WD90C00     (Paradise VGA 1024)
  145.  
  146.     supported by xfree86:
  147.     TVGA         TRIDENT 8900c, 9000, support is in xfree86    
  148.  
  149.     ATI        See the ATI section below.
  150.  
  151.             Those with 8514 compatible cards may want to get 
  152.             the X8514 server for speed (~2x xstones?).
  153.  
  154.     MONO    Any vga card should be able to use X386mono server. (At least
  155.         640x480 with 800x600 virtual). Use the vga2 section of Xconfig.
  156.         Support for hercules monochrome card (usable as 2nd display).
  157.  
  158. The following servers will usually not handle all the options supported by 
  159. xfree86. Read the documentation that comes with them carefully. They
  160. will be merged with the xfree86 distribution in some time.
  161.  
  162.  
  163. 8514    ATI graphics ULTRA, ATI graphics Vantage 
  164.     Should work with any VESA standard 8514/A register compatible
  165.     card? Courtesy Kevin Martin (martin@cs.unc.edu).
  166.  
  167.     Scott Laird (lair@midway.uchicago.edu) writes: 
  168.     I uploaded a new version of the X8514 X Server to sunsite and 
  169.     tsx-11. It is in /pub/Linux/X11/X-servers/X8514/X8514scale.tar.Z
  170.     on sunsite. It's linked with version 4.2 of the jumptable libraries,
  171.     includes TCP/IP support, support for compressed bitmap fonts, Type 1 
  172.     and Speedo scalable fonts.  There's a README file in the same 
  173.     directory that will answer more questions.
  174.  
  175. XS3    S3 chipset server (Jon Tombs jon@robots.ox.ac.uk)
  176.     Get the FAQ on ftp.robots.ox.ac.uk (pub/linux/S3 check sunsite).
  177.  
  178. Xega    Generic 640x480x16 compatible server (originally for laptops).
  179.     This requires a microsoft mouse at /dev/mouse for now
  180.     and it does not use Xconfig so use environment variables
  181.     to define the font path etc. in .xinitrc:
  182.     export FONT_PATH=/usr/lib/X11/fonts/misc:/usr/lib/X11/fonts75dpi
  183.     Works better with courier fonts so add to .Xresources:  
  184.     *Font: -*-courier-medium-r-*--10* ..or whatever..
  185.     A link kit is available at tsx-11 (you need gcc2.2.2).
  186.     in pub/linux/ALPHA/Xega/X386.ega.T.Z
  187.     (Obselete? Unusable? Anyone?)
  188.  
  189.  
  190. WARNING: Do not try to bring up an Xserver that does not support your 
  191. hardware. There have been cases where damage has resulted from pushing
  192. the monitor (specially fixed frequency monitors) beyond its specs.
  193.  
  194.  
  195.  XII.06)  What Mouses are supported?
  196.  
  197. ANSWER: Serial : Logitech, Microsoft, MouseSystems .... compatibles ...
  198.     Busmouses : Logitech, microsoft, ATI_XL, PS/2 (aux).
  199.  
  200.  
  201.  XII.07)  Does anyone have a working PS/2 mouse? Has anyone gotten the 
  202. "Mini-DIN" mouse on an HP Vectra 486/33T to work? The slight info I've 
  203. been able to find says it's PS/2 compatible. Does anyone have a
  204. working MouseMan on a PS/2 port ?
  205.  
  206. ANSWER: (heeb@watson.ibm.com)
  207. First you need to create an entry in /dev for it:
  208.  
  209. mknod /dev/psaux c 10 1
  210.  
  211. The other steps depend on the version of XFree: for XFree86-1.2
  212. add the following line to your Xconfig (and you are done):
  213.  
  214. PS/2 "/dev/psaux"
  215.  
  216. This works even for 3 button mice (e.g. the MouseMan)!
  217. There is no direct PS/2 mouse support in XFree86-1.1, so to use the
  218. mouse with X you'll have either to upgrade or use the mconv mouse
  219. protocol conversion utility, which can be found on nic.funet.fi, in
  220. /pub/OS/Linux/utils/tools/mconv.c. This program converts the packets
  221. sent by the PS/2 mouse into the corresponding ones from a Microsoft
  222. mouse, so you can fool X telling it you have a Microsoft serial
  223. mouse instead. Instructions for use are included in the source file.
  224. (Johan Myreen jem@cs.hut.fi)
  225.  
  226.  
  227.  XII.08)  I have trouble with my logitech Pilot mouse and X under
  228. Linux, any clue ? 
  229.  
  230. ANSWER: (Thomas Roell?) There are TWO lines of Logitech mice out there.
  231. One is the programmable and uses MouseSystems protocol at startup.
  232. X386 reprogramms them to use another protocol. If you specify
  233. 'Logitech' in the Xconfig, X386 assumes a mouse like C7 or S9 (notC7-M).
  234. The second line is the MicroSoft compatible. Currently all newer
  235. Logitech mice follows this practice, like the MouseMan. In that case
  236. you have to say 'MicroSoft' or 'MouseMan'. 
  237.  
  238. From: jliddle@rs6000.cmp.ilstu.edu (Jean Liddle)
  239. I just purchased a new logitech mouseman, and yes, the new X-Windows
  240. (XFree86 as opposed to X386) requires that you use the "microsoft" mousetype.
  241. However, if you turn Third Button Emulation off, the middle button WILL work.
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248. XII.C. LINUX DISTRIBUTION
  249. ~~~~~~~~~~~~~~~~~~~~~~~~~
  250.  
  251.  XII.09)  What is the current version?
  252.  
  253. ANSWER:    The newest public Linux release is xfree86-1.2. 
  254. It was compiled with gcc-2.3 (jump tables 4.3) and is available 
  255. for example at tsx-11 in pub/linux/packages/X11/XFree86-1.2/.
  256.  
  257.  XII.10)  What Files do I need to download?
  258.  
  259. ANSWER: For xfree86: There is a README file in the distribution directory.
  260. Bring this down first and read it. Then get xbin, xman and xfonts.
  261. You need xprog and xlibman only if you plan to compile X applications.
  262. You need xkit if you want to relink the server.
  263.  
  264. **** You need The shared images libc.so.4 (4.3 or later) and libm.so.4 (4.0) 
  265. in /lib/. All the X11 binaries use these. These are available with the GCC
  266. distribution or any new rootdisk. To compile programs you should
  267. get gcc-2.3 or later and the 4.3 libraries.
  268.  
  269. To get a different server, see the notes in the previous section.
  270.  
  271. X11 directories in the archive sites are:
  272. tsx-11 : pub/linux/packages/X11, pub/linux/usr.bin.X11
  273. sunsite : pub/Linux/X11/ 
  274.  
  275.  
  276.  XII.11)  Where do the X11 files go? What are they?
  277.  
  278. ANSWER: The linux X binary distribution looks something like:
  279.  
  280. /usr/X386/
  281.         lib/
  282.         libX11.a ...     (X libraries needed for compiling stuff).
  283.             X11/
  284.                  config/      (template files for compiling ... xmkmf) 
  285.                    fonts/
  286.                    misc/ , 75dpi/ .... 
  287.                    etc/         (documentation).
  288.         bin/                 (X386, X386mono, xterm, X linked to X386).
  289.         include/X11/         (include files needed for compiling).
  290.                bitmaps/  (icons, bitmaps used by some applications).
  291.         man/
  292.         man1/, man3/, cat1/, cat3/
  293. /lib
  294.     libX??.so.??         (Shared images needed by all X11 binaries).
  295.  
  296.  
  297. Its best you do a tar -tvzf on the distribution you get or find
  298. some means of extracting the distribution file list.
  299. The support files include default/example Xconfig, xinitrc, twmrc
  300. which you could copy to your HOME directory (as Xconfig, .xinitrc
  301. and .twmrc) and edit them to define your hardware and X11 setup.
  302. The directory XLIB/etc/ contains much documentation on how to 
  303. configure video modes.
  304.  
  305. Read the files XDOC/README and XDOC/README.Linux.
  306.  
  307.  
  308.  
  309.  
  310. XII.D.  LEARNING/USING X
  311. ~~~~~~~~~~~~~~~~~~~~~~~~
  312.  
  313.  XII.12)  Where can I find the basic help for learning/using X ?
  314.  
  315. ANSWER: Try man X386; man Xserver; man xterm; man twm; man xinit
  316. on any machine with X11.  The man pages on xterm and twm will reflect
  317. behaviour on Linux systems quite accurately. The others will give you
  318. some bearing though not every option will work.  These man pages are
  319. part of the xfree86 distribution.
  320.     
  321.  
  322.  XII.13)  What docs are available besides man pages?
  323.  
  324. ANSWER: The FAQ in comp.windows.x is extensive and has a bibliography. 
  325. There is also the Xt-FAQ. Both are available from export.lcs.mit.edu in
  326. pub/contrib/. There is a collection of (mit) X11 documents on tsx-11
  327. (pub/linux/doc/xdoc.tar.Z ?) or export (pub/R5-Untarred) if you are 
  328. interested in internals.
  329. Also of interest if you use motif, open-look/xview or interviews:
  330. comp.windows.x.motif, comp.windows.open-look, comp.windows.interviews.
  331.  
  332.  
  333.  XII.14)  How do I start up X?
  334.  
  335. ANSWER: Type 'startx' at the shell prompt. Before doing this you should:
  336. 0) Untar the xfree86 distribution from / (read XDOC/README, XDOC/README.Linux).
  337. 1) copy the file Xconfig.sample from the XLIB/ directory to your 
  338.     HOME directory (/usr/root/Xconfig?) or to XLIB/Xconfig.
  339. 2) Edit Xconfig and set the video data for your card and monitor. 
  340.    Use the clocks appropriate for your card and the modes appropriate 
  341.    for your monitor for those clock values. To determine what values are
  342.    appropriate the Xconfig section below and the files in XDOC/. 
  343. 3) Set the mouse device in Xconfig correctly....Use the busmouse entry
  344.    for Logitech only. For other busmouses use microsoft (try all :-).
  345. 4) Ensure that there is a termcap entry for xterm in /etc/termcap
  346.    (One is available in the subdir /doc/).
  347. 5) Ensure that the X11 binaries are in the path example:
  348.    add the line PATH=${PATH}:/usr/X386/bin to ~/.profile or
  349.    look at bash.ad in /doc/.
  350. WARNING: NONE of the modes (in the Modes line in Xconfig) should use a 
  351. clock your monitor cannot handle.
  352. Now type startx.
  353.  
  354.  
  355.  XII.15)  How do I configure X .. colors, menu, keyboard?
  356.  
  357. ANSWER: makes me ... dizzy ...
  358. server : video, keyboard
  359.     Xconfig : man X386, man Xserver, XDOC/VideoModes.doc
  360.               man X386keybd, man xset, man xmodmap. 
  361.  
  362. resources: global and application preferences.
  363.     XLIB/xinit/.Xresources or ~/.Xresources : man xrdb?
  364.  
  365. twm :   menus, title bars, colors .. look and feel.
  366.     ~/.twmrc or XLIB/twm/system.twmrc : man twm
  367.  
  368. xinit : startup. 
  369.         ~/.xinitrc or XLIB/xinit/xinitrc -- man xinit
  370.  
  371. applications : XLIB/app-defaults/Xxx (also ~/.Xresources)
  372.         man xxx
  373.  
  374. You can start with files from any X11 setup. Backup the files 
  375. you change. See the FAQ on comp.windows.x.
  376.  
  377.  
  378.  XII.16)  [suggested by Thomas Koenig]
  379.     How do I support national keyboards in X11 ?
  380.  
  381. ANSWER: Put a .Xmodmap file into the user's home directory specifying
  382. which keys to use for what; or else replace the
  383. /usr/lib/X11/xinit/.Xmodmap with the national keyboard keys
  384. customized. Do man xmodmap for more details. 
  385. enclosed an excerpt of mine (french keyboard):
  386. keycode   8 =
  387. keycode   9 = Escape
  388. keycode  10 = ampersand 1
  389. keycode  11 = eacute 2 asciitilde
  390. keycode  12 = quotedbl 3 numbersign
  391. keycode  13 = apostrophe 4 braceleft
  392. keycode  14 = parenleft 5 bracketleft
  393. keycode  15 = minus 6 bar
  394. keycode  16 = egrave 7 grave
  395. keycode  17 = underscore 8 backslash
  396. keycode  18 = ccedilla 9 asciicircum
  397. keycode  19 = agrave 0 at
  398. keycode  20 = parenright degree bracketright
  399. keycode  21 = equal plus braceright
  400. keycode  22 = BackSpace
  401. keycode  23 = Tab
  402. keycode  24 = A
  403. ........
  404.  
  405.  
  406.  
  407.  
  408.  
  409. XII.E. DEBUGGING STARTUP PROBLEMS:
  410. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  411.  
  412.  XII.17)  I cannot type in my xterm 
  413.  
  414. ANSWER: /dev/console must have major=4, minor=0
  415.     rm -f /dev/console; ln /dev/console /dev/tty0
  416.  
  417.  
  418.  XII.18)  What are some of the common omissions and errors?
  419.  
  420. ANSWER: (Peter)
  421. 1) Add /usr/X386/bin/ (or /usr/bin/X11) to your path.
  422.  
  423. 2) Add the xterm termcap entry to /etc/termcap.
  424.  
  425. 3) ln -s X386 X in the XBIN directory.
  426.    ln -s X386mono X (if you want to use the mono server).
  427.  
  428. 4) Run X as root first. This avoids some trivial problems.
  429.  
  430. 5) If you change the font path entry .... X386 is finicky about
  431.    the syntax. 
  432.  
  433. 6) Make sure your mouse entry in Xconfig points to a legitimate serial 
  434.    device  (or busmouse)... usually something like:  microsoft "/dev/ttyS1"
  435.    serial devices have major # 4 minor 64,65 ... busmouses are major 10.
  436.    ls -l in /dev will show you the major and minor entries.
  437.  
  438. 7) Need read/write/exec access to /tmp directory 
  439.  
  440. 8) Use startx 2> x.err to log your error messages. If the server sticks 
  441.    and you have to reboot you'll probably loose this stuff... see notes
  442.    on `hanging' below.
  443.  
  444. 9) You must have a free vt (eg. /dev/tty5 with no getty (see /etc/rc)).
  445.  
  446. 10) Delete /tmp/.Xn-lock if recovering from a crash.
  447.  
  448. 11) Note the new probeonly option for the server (man X386):
  449.     startx -- -pn -probeonly 
  450.  
  451. 12) See Xconfig problems and the device list below.
  452.  
  453.  
  454.  
  455.  XII.19)  Why is the server unable to find some of the fonts?
  456.  
  457. ANSWER: First check that the directories listed in the font path exist
  458. and have font files in them. Some of the servers are not set up to use 
  459. compressed fonts. In such cases you have to uncompress the fonts in the
  460. directory and run `mkfontdir .`. Read the man page on mkfontdir.
  461.  
  462.  
  463.  XII.20)  My server "hangs" Why?
  464.  
  465. ANSWER: (Peter) Quite often it isn't a hang. If the server grabs the
  466. screen(and enters graphics mode) and then dies, it may return you to
  467. bash *without* restoring the screen. In other words, just because you
  468. see no output, don't assume it's running/hanging.  The way to test
  469. this is to see if you can use a bash command to spin your disk. eg.:
  470. sync; ls -l /bin.
  471.  
  472. Also - I *suspect* that (at least for me), you can kill the
  473. server if you include the servernum option in the Xconfig (Obselete?)
  474.  
  475. You can kill the server when you want to by typing ctrl-alt-backspace. 
  476. Then a couple of ctrl-C 's in case your stuck in xinit.
  477.  
  478. The two line message
  479.          X386 version .....
  480.          (protocol Version ....
  481. is returned from the X386 programme itself, so if you get
  482. this (or if the screen blanks) X must be starting.
  483.  
  484.  
  485.  XII.21)  When I started X11 I got "Cannot connect to
  486. server" or "process does not exist", any clue ?
  487.  
  488. ANSWER: The cause might be a wrong fontpath variable, mouse device
  489. or video settings in your Xconfig.
  490.  
  491.  
  492.  XII.22)  Why cant I run more than 4 xterms?
  493.       How can I have more than 4 pty's ?
  494.  
  495. ANSWER: set the number in the header include/linux/tty.h and 
  496. recompile the kernel. Also make nodes :
  497.     mknod /dev/ptypxx 4  minor  (where minor = 128 + xx)
  498.     mknod /dev/ttypxx 4  minor  (minor = 192 + xx)
  499.     This is for before linux-0.97pl6.... for later versions
  500.     you only need to make the nodes.
  501.     
  502.  
  503.  
  504.  XII.23)  How does X11 start up?
  505.  
  506. ANSWER: The startup involves the server (XBIN/X), and some
  507. programs like startx and xinit.
  508.  
  509. Typing startx runs the script  XBIN/startx. Look through startx. 
  510. For explanation of the server arguments try man Xserver.
  511. startx does little other than gather arguments and then call xinit.
  512.  
  513. xinit runs the server X (X is linked to X386) and the client programs
  514. specified in ~/.xinitrc. xinit continues to run, and is often the 
  515. source of the error messages you see when you exit. If you get the 
  516. message "giving up", it means X has died (quite probably  it died 
  517. immediately) and xinit has been unable to start clients from the 
  518. xinitrc script. (The scripts must be executable).
  519.  
  520.  
  521.  XII.24)  What devices does X depend on:
  522.  
  523. ANSWER: check your device numbers with ls -l /dev. You should have:
  524.  
  525. 5 0 tty
  526. 4 0 tty0
  527. 4 0 console
  528. 4 1 tty1 (etc)        virtual consoles (vt's) : eg. startx -- vt8
  529. 1 1 mem
  530.  
  531. 4 128 ptyp0         pseudo ttys used by xterm/emacs etc 
  532. 4 129 ptyp1 (etc)    to talk to unix programs.
  533. 4 192 ttyp0
  534. 4 193 ttyp1 (etc)
  535.  
  536. 4 64 ttyS1         one of these is the mouse 
  537. 4 65 ttyS2        or you have a busmouse.
  538. 10 x mouse         busmouse x = 0 => logitech     1 => ps/2 (aux)
  539.             2 => microsoft        3 => ATI_XL.
  540. /tmp/.X11-unix/Xn       n = display number. Socket used by X11 programs to 
  541.             talk to the server. This is created by X386.
  542. /tmp/.Xn-lock          n = display number. Lock file.
  543.  
  544. Note that unix programs dont expect standard names for serial devices 
  545. and mice. So you can give these devices any name as long as you tell 
  546. the server what its called (in Xconfig).
  547.  
  548.  
  549.  
  550. XII.F. Xconfig: Xconfig and Video mode settings.
  551. ~~~~~~~~~~~~~~~
  552.  XII.25)  What do the mode names in Xconfig mean?
  553.  
  554. ANSWER: Mode names like "640x480" are used to match entries in 
  555. the modes line with the modeDB entry which actually defines the mode. 
  556. You can toggle between modes in the modes line  with ctrl-alt-numericplus. 
  557. If you're experimenting with 640x480 you can define 
  558.       modes "640x480a" "641x480b" "642x480c"
  559. with different entries for each under ModeDB so you can toggle between 
  560. these three modes. 
  561.  
  562.  XII.26)  How do I compute the numbers for the video modes?
  563.  
  564. ANSWER: See if there is an entry that matches your chip/monitor in
  565. XDOC/modeDB.txt. Use the clock entries for your chip
  566. and the mode entry for that clock appropriate for your monitor.
  567. If you cant find a mode entry for a particular clock 'needed_clock'
  568. but can find a mode entry (for your monitor) for a nearby clock value
  569. 'found_clock', scale all numbers in the modeDB entry by 
  570. (needed_clock/found_clock). Read XDOC/VideoModes.doc
  571.  
  572.  
  573.  XII.27)  How can I determine the clocks on the video chip?
  574.     Where can I find clock.exe or clock.pas ?
  575.  
  576. ANSWER: The XFREE Team discourages the use  of clocks.exe and wants it
  577. to be removed from all docs, since the new Server is better at
  578. guessing the clocks than clocks.exe.
  579.  
  580. You can get X to tell you what it finds by commenting the clocks entry 
  581. in Xconfig. Use 'startx -- -probeonly 2> x.err' to log the output.
  582. If X starts up this file gets the clocks only after you exit.
  583.  
  584. I strongly advise using the 'modegen' spreadsheets to generate the 
  585. appropriate settings. If I remember correctly you can find them in 
  586. 'pub/linux/packages/SLS/x4' called modegen.taz or something equally 
  587. as obvious ... Good luck. (Andy asb@cs.nott.ac.uk)
  588.  
  589. The clocks entry in Xconfig serves as an index. example: 
  590. clocks 1 2 
  591. ModeDB
  592. 1 640x480 .....
  593. 2 800x600 .....
  594. means the first clock on the chip will be used for the 640x480 mode
  595. and so on. Usually one uses the MHz value for the clock for convenience
  596. instead of 1 2  you probably have 25 28 ... etc.
  597.  
  598.  
  599.  XII.28)  What are the settings used with a trident-8900C?
  600.  
  601. ANSWER: To get X/SLS/Linux working with a trident-8900C :
  602.  
  603. 1) From Frank Houston fh8n@uvacs.cs.Virginia.EDU 
  604. vga256
  605.   Virtual    1024 768
  606.   ViewPort      0 0
  607.   Modes            "1024x768" "800x600" "640x480"
  608. Use the VESA monitor timings from the modeDB in the example Xconfig.
  609. You do not need to specify the chipset or clocks.
  610.  
  611. 2) From: Henk Vandecasteele henkv@cs.kuleuven.ac.be 
  612. TRIDENT TVGA 8900C card with BIOS C2.11, A cheap color monitor AOC (CM-335) 
  613. with a maximum horizontal frequence of 39.5
  614. vga256
  615.   Virtual    1024 1024
  616.   ViewPort      0 0
  617.   Modes        "912x684" "800x600" "640x480" 
  618. # This mode drives my monitor to the limit (VESA timings for the rest).
  619.  "912x684"     45      912  944 1104 1136    684  684  690  712 
  620.  
  621.  
  622.  XII.29)  Oh what, Oh what, Oh what can I do with a trident 8900b?
  623.  
  624. ANSWER: (drew@cs.colorado.edu)
  625. 1.  While the 8900b works with the Xfree 8900c driver, you must 
  626.     specify a chipset line for the 8900c in your Xconfig.
  627.  
  628. 2.  The tridents are miserably slow in a Color mode.  If you don't 
  629.     mind black and white, you should use X386mono.  Not only is it 
  630.     faster, but it requires less video memory, and you'll be able 
  631.     to run a 1k X 1k virtual desktop. Again, you must specify the 
  632.     Chipset line to use the banked mono server for virtual 
  633.     resolutions > ~800x600.
  634.  
  635.  
  636.  XII.30)  What are common problems with Xconfig?
  637.  
  638. ANSWER: If X isn't firing at all, or even if it clears the screen and
  639. crashes (see below) you almost certainly have a fault in Xconfig.
  640.  
  641. 1. Note that the server X interprets Xconfig. (not xinit)
  642.  
  643. 2. test with only one graphics mode included - one you are most sure of.
  644.  
  645. 3. If you make a mistake in the mouse section, you will (I understand)
  646. get an error message, so if you don't get some mouse error, try
  647. elsewhere first. (eg "No such file or directory" indicates you have a
  648. fault in the "/dev/ttyxx" line, or /dev/ttyxx doesn't exist.
  649.  
  650. 4. *NB* X looks in your home directory first to find an Xconfig. make
  651. certain it's using the one you've been working on!
  652.  
  653. 5. you need double quotes (") around your chipset and modes: eg
  654.     chipset "et4000"
  655.     Modes   "640x480" "640x480a" "800x600"
  656.    and around the /dev/ttyxx eg.:
  657.     microsoft "/dev/ttys1"
  658.  
  659. 6. Check your VGA section and modeDB first.
  660.  
  661. 9. ensure ModeDB clock speeds match the VGA section. Comment out any
  662. unused lines in MODEDB.
  663.  
  664. eg  clocks  25 36 00 00 00 00 00 00 
  665.  
  666. then you *must* have (and only have) lines under modeDB corresponding
  667. to speeds 25 and 36. If you have one with (say) 62 uncommented out in
  668. the modeDB section in place of the 36 line, you will cause the server to
  669. die immediately with no error message.
  670.  
  671. 10. videoram must equal the amount of display ram on your chip.
  672.  
  673. 11. The virtual resolution screen must fit in the videoram.
  674.     eg: 512kB => 800x600 (for the 1 byte per pixel color server)
  675.  
  676.  
  677.  XII.31)  What do I use in my Xconfig file to use the bus mouse?
  678. Logitech doesn't work with my Logitech busmouse.
  679.  
  680. ANSWER: (Nathan I. Laredo)
  681. Here are the mouse lines from my Xconfig:
  682.  
  683. BusMouse   "/dev/mouse"
  684.  
  685. You may add a sample rate if you want, but chances are, unless the model
  686. number on your mouse matches mine: PC-93-9MD it probably will cause your
  687. machine to lock up, as I've gotten several reports saying that.
  688. According to the X386 documentation, non-logitech mice do not support
  689. a sample rate.
  690.  
  691.  
  692.  XII.32)  Where can I get Xconfig-files for various hardware?
  693.  
  694. ANSWER: If you have access to e-mail, e-mail  bcr@physics.purdue.edu 
  695. a  message with the  subject: help 
  696. If you do create a new Xconfig file or improve on an old one please mail
  697. it to bcr@physics.purdue.edu to save others from having to duplicate
  698. your work.
  699.  
  700.  
  701.  
  702. XII.G X-APPLICATIONS: Compiling X Programs.
  703. ~~~~~~~~~~~~~~~~~~~~~
  704.  
  705.  XII.33)  Does anyone know where I can find the libobz.a library ?
  706.  
  707. ANSWER: This library contained the socket stuff, when X386 V0.1 was
  708. released. Meanwhile it has found it's way into the kernel, so
  709. remove -lobz from the link step in the Makefile. Any program
  710. asking for libobz needs to be recompiled anyway.
  711.  
  712.  
  713.  XII.34)  I get _setjmp undefined when linking xv from .a files.
  714.  
  715. ANSWER: You are trying to link a program compiled with gcc-2.2.2
  716. and setjmp has changed sice then. Recompile xv from the source
  717. using the latest gcc.
  718.  
  719.  
  720.  XII.35)  How do I compile an X application that has an Imakefile?
  721.  
  722. ANSWER:
  723.     Type xmkmf to generate the Makefile.
  724.     Type make.
  725.  
  726.  
  727.  XII.36)  How do I compile a program that has no Imakefile?
  728.  
  729. ANSWER: Use compiler options generated with programs that do have
  730.     Imakefiles. Look in XLIB/config/ for the linux definitions.
  731.     In particular you need -fwritable-strings.
  732.  
  733.  XII.37)  gcc complains the X libraries are not found or links static.
  734.  
  735. ANSWER: Check out the -nojump -static options of GCC ... read the GCC FAQ.
  736.     You can tell gcc what directories to search with -L. 
  737.  
  738.  
  739.  XII.38)  When using Makefiles generated by xmkmf why do I get many error 
  740.     messages?
  741.  
  742. ANSWER: The old xmkmf under Linux doesn't like # comments in Imakefiles. 
  743. Therefore you must change the #'s to XCOMM. But be careful. Don't change
  744. any pre-compiler directives. (mal11@po.CWRU.Edu  Matthew A. Lewis)
  745.  
  746.  XII.39)  (Ton van Rosmalen wrote):
  747. I recently compiled XFree86 1.2A for Linux and it compiled fine with
  748. gcc-2.3.3 and libc-4.3.3 iff I skipped the make depend.
  749.  
  750. ANSWER: (Rik Faith)
  751. The source for ed.c is available from (Linux binaries are in utilb13.taz)
  752. ftp.cs.unc.edu:/pub/faith/linux/utils/utilb-1.3.src.tar.Z 
  753. This version of ed.c has a 4096 character line limit and will work
  754. correctly when building XFree86 under Linux.
  755.  
  756.  
  757.  XII.40)  What are the  development tools available for X under Linux?
  758.  
  759. ANSWER: Some of the X development packages available on Linux:
  760. (XS = sunsite.unc.edu pub/Linux/X11)
  761. (Contact the people who distribute them in case of problems.)
  762.  
  763. Libraries: 
  764. Xpm, tiff .. are in XS/libs/. If you are compiling a package 
  765. that uses these libraries it is best to pick up the standard DLLs.
  766. hooft@chem.ruu.nl, mitchum.dsouza@mrc-apu.cam.ac.uk
  767. (Some older libraries are in XS/libs/oldlibs).
  768.  
  769. Interviews: SLS package
  770. Shared libraries are not yet available so doc ~1M, idraw ~1.5M, ibuild?
  771.  
  772. KHOROS:
  773. This is the second release of my patches (~15K XS/xapps) to the Khoros 
  774. system for image processing. If you want to compile it, you 
  775. need Khoros 1.0, patchlevel 5 (source distribution) and up to 100MB 
  776. free disk space (including package 0.).  
  777. Wolfram Gloger wmglo@dent.med.uni-muenchen.de Apr 04 1993.
  778.  
  779. MOTIF XS/$$$:-)
  780. Metro Link, Inc. is pleased to announce the availability of OSF/Motif 1.2.2 
  781. for Linux at the introductory price of $199 for a complete runtime and 
  782. development system (shared libs, UIL, source for some demos + 1 Orielly book). 
  783. You can order OSF/Motif 1.2.2 for Linux by calling Metro Link,Inc. at 
  784. (305) 970-7353 (voice) or (305) 970-7351 (fax) or by mailing us at 
  785. sales@metrolink.com.
  786.  
  787. SUIT: XS/devel
  788. Simple User Interface Toolkit. 
  789. Included are shared libs and static libs. Compiled with the SLS kit.
  790. To use these shared libs you need libX11 3.0 and libc 4.3.
  791. Rob Robert-Jan Kooper rob@is.twi.tudelft.nl kooper@dutiws.twi.tudelft.nl
  792.  
  793. tk+tcl: XS/devel
  794. Here is tk3.0 and tcl6.5 sources and libraries. Compiled this with gcc2.3.3
  795. I have also included the wish (X11) binary.  
  796. Mitch mitchum.dsouza@mrc-apu.cam.ac.uk     mitch%markab@mrc-apu.cam.ac.uk 
  797.  
  798. xview: XS/devel
  799. New libxview.a and libolgx.a that correct some problems with the
  800. ones found in SLS (and maybe in the other xview releases, I don't know).
  801. Kenneth Osterberg ??
  802.  
  803.  
  804. XII.H ATI: SVGA server for ATI boards.
  805. ~~~~~~~~~
  806. Last Revised: Mon May 10 15:17:57 1993 by faith@cs.unc.edu
  807.  
  808.  
  809.  XII.41)  What's new?
  810.  
  811. ANSWER:
  812. For XFree86 version 1.2 (and later versions), there are two changes to the
  813. extregPlusXLAndOrMasks table:
  814.  
  815. 1) ER_B0 was changed from 0x28 to 0x31.  (In the Linux world, this was
  816. distributed as a binary patch long ago.)
  817.  
  818. 2) ER_BE was changed from 0x08, but only for cards EARLIER than the
  819. 28800-5.
  820.  
  821. Both of these changes allow more 28800-4 cards to work, although either one
  822. may be sufficient for any one card.  You can find these changes in the
  823. driver by searching for the Feb 3 timestamps.
  824.  
  825.  
  826.  
  827.  XII.42)  What is the ATI SVGA driver?
  828.  
  829. ANSWER:
  830. The ATI SVGA driver is a 256 color driver for the XFree86 server.  The
  831. driver was written for the ATI WONDER series of graphics adapters.  In
  832. general, the following modes are supported for cards with 512kb of memory:
  833.  
  834. 640x480x256
  835. 600x800x256
  836.  
  837. The following modes are supported for cards with 1024kb of memory:
  838.  
  839. 1024x768x256
  840.  
  841.  
  842.  
  843.  XII.43)  What is the ATI SVGA driver *NOT*?
  844.  
  845. ANSWER:
  846. The ATI SVGA driver is *NOT* a black and white (2 bit) driver.  Therefore,
  847. it will *NOT* work with the XFree86 monoserver.
  848.  
  849. The ATI SVGA driver is *NOT* a 16 color driver.  Even though your manual
  850. says that your graphics adapter has a 1024x768x16 mode, the ATI SVGA driver
  851. will *NOT* use this mode.  If you want to use 1024x768, you *MUST* have 1MB
  852. of memory on your board and use the 1024x768x256 mode.
  853.  
  854. The ATI SVGA driver will *NOT* support more than 8 bits of pixel depth.
  855. Therefore, even though your manual says that your graphics adapter supports
  856. modes using more than 256 colors, the ATI SVGA driver will *NOT* use these
  857. modes.
  858.  
  859. The ATI SVGA driver is *NOT* an accelerated driver.  If you have an ATI
  860. GRAPHICS ULTRA series card, the ATI SVGA driver will *NOT* use the
  861. accelerated hardware.  It will only use the SVGA hardware.  This will
  862. probably not be any faster than a VGA WONDER card, unless the card is on a
  863. local bus (and then, it won't be faster than a VGA WONDER card on a local
  864. bus, if a card of this type existed).
  865.  
  866.  
  867.  
  868.  XII.44)  What cards will the driver work with?
  869.  
  870. ANSWER:
  871. This is a difficult question, because there are many different ATI video
  872. cards, and it is sometimes difficult to tell them apart.  The best way is
  873. to look on the card itself for the ATI chip numbers.  Here is a partial
  874. list of ATI VGA WONDER cards.  The MOST IMPORTANT number is the CHIP
  875. VERSION.
  876.  
  877. Adapter version     Dot clock       Chip version
  878.  
  879. VGA WONDER V3                       ATI18800        NOT SUPPORTED
  880. VGA WONDER V4                       ATI18800-1      NOT SUPPORTED
  881. VGA WONDER V5       ATI18810        ATI18800-1      NOT SUPPORTED
  882. VGA WONDER + (V6)   ATI18810        ATI28800-2      ? MAY WORK ?
  883. VGA WONDER (1 MB)   ATI18810        ATI28800-4      SUPPORTED
  884. VGA WONDER (1 MB)   ATI18810        ATI28800-5      SUPPORTED
  885. VGA WONDER XL       ATI18810        ATI28800-5      SUPPORTED
  886.  
  887. Note that the ATI SVGA driver code has hooks and some support for all of
  888. the cards listed.  However, with the earlier cards, there are serious
  889. differences in the programmer's interface.  The only people who have ever
  890. worked on the code have had 28800-4 and 28800-5 chips, so these chips are
  891. the only ones that are actually known to work.
  892.  
  893. The ATI GRAPHICS ULTRA chips seem to have SVGA support which is equivalent
  894. to the 28800-4, 28800-5, and 28800-a, although I can find no documentation
  895. on this in the technical manuals provided by ATI.  The ULTRA PLUS and ULTRA
  896. PRO boards have been tested to some extent, and seem to work fine, but the
  897. original ULTRA may have some problems at greater than 640x480 resolution.
  898.  
  899.  
  900.  
  901.  XII.45)  What should I put in my Xconfig file?
  902.  
  903. ANSWER:
  904. THE MOST IMPORTANT LINE IS THE CLOCKS LINE:
  905.  
  906.   Clocks        18 22 25 28 36 44 50 56
  907.                 30 32 37 39 40 0  75 65
  908.  
  909. The first row of clocks is usable on all VGA Wonder cards.  The second row
  910. is usable only on V5, PLUS, and XL cards (28800-2, 28800-4, and 28800-5).
  911. However, you should include *BOTH* rows for *ALL* cards.
  912.  
  913. The specification is different from the specification used with the ET-4000
  914. cards.  Programs with claim to detect the clocks usually work only with
  915. ET-4000 based cards.  No such program exists for the ATI cards, since it
  916. isn't needed.  THE CLOCKS LINE SHOULD NEVER BE CHANGED.  The order of
  917. numbers in the clocks line *is* significant.
  918.  
  919. The actual frequencies, which can be used to calculate the ModeDB lines,
  920. are as follows:
  921.  
  922. 18 = 18.000
  923. 22 = 22.450
  924. 25 = 25.175
  925. 28 = 28.320
  926. 36 = 36.000
  927. 44 = 44.900
  928. 50 = 50.350
  929. 56 = 56.640
  930.  
  931. 30 = 30.240
  932. 32 = 32.000
  933. 37 = 37.500
  934. 39 = 39.000
  935. 40 = 40.000
  936.  0 = 56.640
  937. 75 = 75.000
  938. 65 = 65.000
  939.  
  940. The Chipset will be automatically detected.  The chipset name for this
  941. driver is "ati".
  942.  
  943. Here is a sample Xconfig (which I use):
  944.  
  945. RGBPath        "/usr/lib/X11/rgb"
  946. FontPath    "/usr/lib/X11/fonts/misc/,/usr/lib/X11/fonts/75dpi/"
  947.  
  948. Keyboard
  949.   AutoRepeat 500 5
  950.   ServerNumLock
  951.  
  952. #Microsoft    "/dev/mouse"
  953. #MouseSystems    "/dev/mouse"
  954. #MMSeries    "/dev/mouse"
  955. #Logitech    "/dev/mouse"
  956. #MouseMan    "/dev/mouse"
  957. Busmouse    "/dev/mouse"
  958. #  BaudRate    1200
  959.   SampleRate    150
  960. #  Emulate3Buttons
  961.  
  962.  
  963. vga256
  964.   ViewPort      0 0
  965.   #Modes     "1024x768v" "800x600v"
  966.   Modes            "800x600v"
  967.   Clocks        18 22 25 28 36 44 50 56
  968.                 30 32 37 39 40 0  75 65
  969.   Displaysize   260 184
  970.  
  971. ModeDB
  972.  
  973. # From NEC MultiSync 3FGx manual (copied by faith@cs.unc.edu)
  974. # active_area front_porch pulse_width back_porch for horiz and vert
  975. # VESA 640x480 at 72Hz (37.860kHz)
  976. # 20.317us 0.762us 1.270us 4.603us; 12.678ms 0.238ms 0.079ms 0.740ms
  977. # (I couldn't find a good clock rate for this one)
  978. # VESA 800x600 at 72Hz (48.077kHz)
  979. # 16.000us 1.120us 2.400us 1.280us; 12.480ms 0.770ms 0.125ms 0.478ms
  980. "800x600v"   50      800  856  976 1040    600  637  643  693
  981. # VESA 1024x768 at 60Hz (48.363kHz)
  982. # 15.754us 0.369us 2.092us 2.462us; 15.880ms 0.062ms 0.124ms 0.600ms
  983. "1024x768v"  65    1024 1048 1184 1344    768  771  777  806
  984.  
  985.  
  986.  
  987.  XII.46)  What is the history of the driver?
  988.  
  989. ANSWER:
  990. The complete history of the driver is cloudy.  I have tried to reconstruct
  991. the history from several email messages from a few of the people involved.
  992. The history is probably incomplete and inaccurate.
  993.  
  994. Apparently, Per Lindqvist (pgd@compuram.bbt.se) first got an ATI driver
  995. working with an early ATI card under X386 1.1a.  (This original driver may
  996. have actually been based on an non-functional ATI driver written by Roell.)
  997. Then Doug Evans (dje@cygnus.com) ported the driver to the ATI XL, trying in
  998. the process to make the driver work with all other ATI cards.
  999.  
  1000. I (Rik Faith) obtained the X11R4 driver from Doug Evans in the summer of
  1001. 1992, and ported the code to the X386 part of X11R5.  This subsequently
  1002. became part of XFree86.  Per and Doug did the majority of work, making the
  1003. port somewhat trivial.  I am grateful for their contribution.
  1004.  
  1005. The port to X11R5 required writing the ATIProbe and ATIEnterLeave routines,
  1006. and re-organizing the ATISave and ATIRestore routines.  Someone else added
  1007. the operating system specific code, but I don't know who.
  1008.  
  1009. The major reference that I used was manual from ATI:
  1010.  
  1011. "VGA WONDER Programmer's Reference"
  1012. ATI Technologies, 1991.
  1013. Release 1.2 -- Reference #PRG28800
  1014. (Part No. 10709B0412)
  1015.  
  1016. However, Chapter 11 (ATI 18800 ATI VGAWONDER) of George Sutty and Steve
  1017. Blair's "Advanced Programmer's Guide to SuperVGAs" (Brady/Simon & Schuster,
  1018. 1990) was also useful.  Further, someone e-mailed be a random document from
  1019. the ATI BBS which was dated 3Jul91 and which may have been named
  1020. PROGINFO.DOC.
  1021.  
  1022.  
  1023.  
  1024.  XII.47)  What is the future of the driver?
  1025.  
  1026. ANSWER:
  1027. I no longer use an ATI Wonder card and have no interest in this driver.
  1028. Since I have received no bug reports or patches for the driver during the
  1029. past 3 months, I think it is about as stable as it is going to get.  (I
  1030. suspect that support for the 28800-2, 28800-4, and 28800-5 chips can be
  1031. made more robust, but I doubt that the other chips will ever be fully
  1032. supported.)
  1033.  
  1034. I have absolutely *NO* intention of porting the code to the mono or 16
  1035. color servers.  If *you* want ATI support in the mono or 16 color servers,
  1036. they *you* should do the port.  (Since I no longer use my ATI Wonder card,
  1037. please feel free to take over the current driver as well.)
  1038.  
  1039.  
  1040.  
  1041.  
  1042. XII.I BUGS:
  1043. ~~~~~~~~~~~
  1044.  
  1045. Restoration of the text screen fails on some hardware. You can
  1046. get the program runx from the vgalib distribution (tsx-11
  1047. pub/linux/sources/libs/). Report the problem to the xfree86 team.
  1048.  
  1049. Cant compile Xaw programs without -static in versions x11v1.1 or older.
  1050.  
  1051. Fix for missing numlock control in xfree86-1.1.
  1052. use xmodmap to change the mapping:
  1053.   clear mod1
  1054.   add mod1 = Alt_L
  1055.   keysym Alt_R = Mode_switch
  1056.   add mod5 = Mode_switch
  1057. David (Dawes)
  1058.  
  1059.  
  1060.  
  1061. Sources for X11_FAQ: 
  1062. Steve Kotsopoulos, Peter Hawkins, John Morris, MM. Corsini, 
  1063. K. Balasubramanian. 
  1064. Direct comments, questions, complaints to krishna at:
  1065. balasub@cis.ohio-state.edu
  1066.  
  1067.  
  1068.  
  1069. XIII.    NETWORKING and LINUX
  1070. ============================
  1071. *** This section should be maintained by Philip Copeland
  1072. *** (p_copela@csd.uwe.ac.uk). 
  1073.  
  1074.  
  1075. XIII.01)  Where can I find useful information about networking for
  1076. Linux ?
  1077.  
  1078. ANSWER: Join the NET channel of the mailing list. Also, you need to
  1079. read the NET-FAQ by Phil Copeland, it's on sunsite and tsx-11 and
  1080. posted to c.o.l and the NET channel every couple of weeks.
  1081.  
  1082. Basically, all of the information on networking and TCP/IP for Linux
  1083. is in the NET-FAQ, because it's maintained seperately than this
  1084. document (and we don't want to waste the space reprinting it all
  1085. here--- it's big!).
  1086.  
  1087. The NET-FAQ has been completely rewritten as of Feb 1993. Get the new
  1088. version. 
  1089.  
  1090.  
  1091.  
  1092. XIV.  EVERYTHING FOR PRINTING
  1093. =============================
  1094. **** This is the lpd FAQ version 1.2 (last update 1st june), this
  1095. **** section is maintained by Brian McCauley. Please send any
  1096. **** suggestion to: B.A.McCauley@bham.ac.uk
  1097.  
  1098.  XIV.01)  What _is_ the lpr/lpd package?
  1099.  
  1100. ANSWER: To quote the net-FAQ:
  1101.  
  1102. Lpr is a utility that is used to print files out to local and remote
  1103. printers. As with all networking, there are configuration files which
  1104. have to be tailored to your needs. These files are concerned with
  1105. access control, accounting and page setup of your printer(s).  Now all
  1106. control of the printer is performed by a process called lpd
  1107.  
  1108. Lpd is a laser printer daemon (yes I know an epson isn't a laser
  1109. printer but thats besides the point). The program lpd is normally
  1110. started in /etc/rc.local in either the forground or the background.
  1111. What happens is that lpd will sink back as a daemon, only ever being
  1112. invoked when a printer request is generated. lpd itself has some
  1113. options which are of possible intrest to some people chiefly that of
  1114. the '-l' flag which causes lpd to log requests recieved from the
  1115. network (useful for debugging). The other option is for what port lpd
  1116. should listen for data on and is generally not used.
  1117.  
  1118. [ Note: lp really stands for line printer but as technology has
  1119. advanced laser printer makes more sense. ]
  1120.  
  1121.  
  1122.  XIV.02)  What is _the_ Linux lpr/lpd ?
  1123.  
  1124. ANSWER: Up until 28th May 1993, as far as there is a definitive Linux
  1125. version of anything _the_ Linux lpr/lpd is <bir7@leland.stanford.edu>
  1126. Ross Biro's port of the BSD sources dated 20th November 1992 (so if
  1127. you're used to AT&T's you'll find some differences).  Ross's binaries
  1128. and the diffs are found in:
  1129.  
  1130. tsx-11.mit.edu:pub/linux/binaries/usr.bin/lpr.tar.Z
  1131. sunsite.unc.edu:pub/Linux/system/Daemons/lpr.tar.Z
  1132.  
  1133. The SLS file lpr.tgz on disk b2 contains the same stuff.
  1134.  
  1135. However this is all about to change so from now on this version will
  1136. be called the "old" binaries. As of 28th May 1993 there appears be two
  1137. different new releases of lpd expected RSN.
  1138.  
  1139. In addition to the standard BSD lpr capabilities Ross Biro's port
  1140. should have had better support for serial printers (but it didn't work
  1141. in the old binaries).
  1142.  
  1143. Ross's port was not based on the latest BSD sources (by about 3 years,
  1144. '88 vs '91). His new release will also be based on these sources which
  1145. can be found are at:
  1146.  
  1147. gatekeeper.dec.com and /afs/ir.stanford.edu/src/...
  1148.  
  1149. Recent BSD sources are all over the place.
  1150.  
  1151. ftp.uu.net:systems/unix/bsd-sources/usr.sbin/lpr
  1152. src.doc.ic.ac.uk:unix/bsd-sources/usr.sbin/lpr
  1153.  
  1154. to name but two. The BSD sources have unGNU things in their Makefiles
  1155. so they don't compile ``out of the box'' but have now been ported by
  1156. <waltje@uWalt.NL.Mugnet.ORG> Fred van Kempen and will be available RSN
  1157. (if not now) as part of the complete overhall of the Linux Net stuff.
  1158.  
  1159. Ross agrees that Fred's version should be thought of as _the_ Linux
  1160. lpd package. I <B.A.McCauley@bham.ac.uk> have not had a chance to look
  1161. at Fred's port yet (I'm waiting for the full release of 0.99pl10
  1162. before I update anything) but most of this FAQ refers to the BSD lpd
  1163. package or Linux in general so this is probably not too important.
  1164.  
  1165. There are some other versions of lpd stuff about but I have to draw
  1166. the line somewhere. If anyone whants to maintain FAQ sections on these
  1167. they are welcome to do so. The other versions include plp and the ka9q lp
  1168. facility. There are also romours of SysV spoolers being ported.
  1169.  
  1170.  
  1171.  XIV.03)  How do I get lpr to work properly other than for root? Where
  1172. do the files go and what should their permissions be?
  1173.  
  1174. ANSWER: Put /etc/lpd& in your /etc/rc or /etc/rc.local (usually in
  1175. /etc/rc.local after you start syslogd (if you use syslogd)).
  1176.  
  1177. Set the group fields of the file permissons/ownership as follows:
  1178.  
  1179. -rwxr-s---   1 root     daemon      37892 Nov 19 23:32 /etc/lpd
  1180. -rwx--s--x   1 root     daemon      21508 Nov 19 23:32 /usr/bin/lpc
  1181. -rws--s--x   1 root     daemon      17412 Nov 19 23:32 /usr/bin/lpq
  1182. -rwx--s--x   1 root     daemon      17412 Nov 19 23:32 /usr/bin/lpr
  1183. -rwx--s--x   1 root     daemon      17412 Nov 19 23:32 /usr/bin/lprm
  1184.  
  1185. ...and for each of the spool directories listed in the sd fields of
  1186. /etc/printcap... 
  1187.  
  1188. /usr/spool/lp1:
  1189. total 5
  1190. drwxrwxr-x   2 root     daemon       1024 May 18 23:00 .
  1191. drwxr-xr-x  11 root     root         1024 Feb 19 20:56 ..
  1192. -rw-rw-r--   1 root     daemon          4 May 18 23:00 .seq
  1193. -rw-rw-r--   1 root     daemon         18 May 18 23:00 lock
  1194. -rw-rw-r--   1 root     daemon         25 May 18 23:00 status
  1195.  
  1196. Note these 3 files are created by lpr and lpd so if you've never
  1197. run these they could be missing so touch them into being.
  1198.  
  1199. Some of these permissions may be overkill so don't be surprised if
  1200. your system works with different permissions. The fact that lpq needs
  1201. to be suid root is inelegant and may change in the future.
  1202.  
  1203. Alternative approach: just make lpc, lpr and lprm setuid(root) then
  1204. you can forget the file permissions on the spool queues!
  1205.  
  1206. You're free to choose different directories for the executables on
  1207. your system (notably lpc is often in /etc even though it has commands
  1208. that are useful to non-root). The master lpd lock file which is always
  1209. in /usr/spool/ so you must have one of those but you needn't
  1210. necessarily keep your spool queues there.
  1211.  
  1212. The main configuration file is /etc/printcap although the old binaries
  1213. look for it in /usr/etc/lpd.  The README says hosts.equiv and
  1214. hosts.lpd files are looked for in /etc/inet but again the more
  1215. accepted convention is to locate them in /etc.
  1216.  
  1217. For an simple life:
  1218.  
  1219. mv -i /usr/etc/inet/* /etc/inet/* /usr/etc/* /etc/
  1220. rmdir /usr/etc/inet /etc/inet /usr/etc
  1221. ln -s ../etc /usr/etc
  1222. ls -s . /etc/inet
  1223.  
  1224. [But make sure the files in /usr/etc and /etc/inet are not already
  1225. symlinks into /etc or you'll be in deep water.]
  1226.  
  1227. Eventually you'll be able to delete these symlinks once you've got rid
  1228. off all the old stuff.
  1229.  
  1230.  
  1231.  XIV.04)  Why do I sometimes see /usr/etc or /etc/inet or /usr/etc/inet?  
  1232.  
  1233. ANSWER: For various reasons including the difficulties of fsck'ing /
  1234. some people like to put all things that aren't needed during bootstrap
  1235. in /usr so that / is as small as possible. Also some people like all
  1236. their internet stuff in /etc/inet. Most Linux gurus advise keeping it
  1237. all in /etc.
  1238.  
  1239. If you really want this quirky layout:
  1240.  
  1241. cd /etc
  1242. ls -s ../usr/etc/* .
  1243. ls -s inet/* .
  1244.  
  1245. [Make sure the files in /usr/etc and /etc/inet are not already
  1246. symlinks into /etc.]
  1247.  
  1248.  
  1249.  XIV.05)  Where do I get a printcap for a xxxxx?
  1250.  
  1251. ANSWER: This question is essentially meaningless - see next question.
  1252.  
  1253.  
  1254.  XIV.06)  What is the content of /etc/printcap?
  1255.  
  1256. ANSWER: Given the similarity in appearence and name between
  1257. /etc/termcap and /etc/printcap one could be forgiven for assuming that
  1258. they contain analogous infomation. This is not the case. Whereas
  1259. termcap contains informations about terminal *types* - (mostly escape
  1260. seqences) printcap contains information about *specific* printers
  1261. (like the directory that holds the spool queue and the device name of
  1262. the printer). The information about a printer model's escape sequences
  1263. and so on are held in the various filters which are _programs_ called
  1264. by lpd to drive the printer. /etc/printcap simply gives the locations
  1265. of these filters.  For details RTFM(printcap). [Alternatively the
  1266. net-FAQ has a summary of some of the more important fileds.]. One last
  1267. point you should always specify ``suppress header'' ``:sh:'' unless
  1268. you have _text_ printer and want banners. (See the banners question
  1269. for further expanation).
  1270.  
  1271.  
  1272.  XIV.07)  What is the format of a /etc/printcap?
  1273.  
  1274. ANSWER: Ideally RTFM(termcap) (yes, I said *termcap*) but since most
  1275. people don't have TFM(termcap) here are the essentials.
  1276.  
  1277. Lines starting # are comments (as you might have guessed).
  1278.  
  1279. For each printer usable from the lpr command on your system there is
  1280. one logical line in the file. For the sake of readability each logical
  1281. line may be spread over several physical lines by making the last
  1282. character on all but the last physical line a backslash.
  1283.  
  1284. Each logical line has the following format:
  1285.  
  1286. name1|name2|name3:string_capability=string:\
  1287.        :numeric_capability#number:boolean_capability:
  1288.  
  1289. The leading spaces and colon on the second line are for readability
  1290. only.
  1291.  
  1292. A printer can have as many names as you like but conventionally the
  1293. final name is used as a longhand description of the printer. (Still
  1294. people are free to say `lpr -P "Fred's grotty teletype"' if that's
  1295. the description you've given.)
  1296.  
  1297. The list of capabilities can be as long as needed and the order is not
  1298. significant. Each ``capability'' is denoted by a two character code.
  1299. (The name ``capability'' comes form the file format's termcap heritage
  1300. - parameter or attribute would be a more sensible terms.) [Note from
  1301. Ross Biro: capabilities with 3 character names don't work properly
  1302. which is why the serial port stuff in the old binaries failed.]
  1303. Capabilities having string value and have a = delimiter between the
  1304. capability name and the value while those having a numeric value use a
  1305. # (actually they can use either a # or an =). Boolean ``capablilties''
  1306. are true if they appear in the list and false if they do not.
  1307.  
  1308. Special characters in a string value can be expressed using `\'-escape
  1309. sequences as in C; in addition, `\E' stands for ESC.  `^' is also a
  1310. kind of escape character; `^' followed by CHAR stands for the
  1311. control-equivalent of CHAR.  Thus, `^a' stands for the character
  1312. control-a, just like `\001'.  `:', `\' and `^' themselves can be
  1313. represented as `\:', `\\' and `\^'.
  1314.  
  1315. Example:
  1316.  
  1317. lp|bam|BAM's Epson FX-80:lp=/dev/lp1:sd=/usr/spool/lp1:sh:mx#0:\
  1318.     :df=/usr/local/lib/magic-filter/lp.df:\
  1319.     :if=/usr/local/lib/magic-filter/lp.if:
  1320.  
  1321. Name is lp (this is the printer that lpr uses by default). It's also
  1322. known as bam or "BAM's Epson FX-80".
  1323.  
  1324. The printer is on /dev/lp1 (aka AT-bus LPT1:). I don't want a burst
  1325. page. I don't want a file length limit. Files queued by `lpr -d' are
  1326. passed through /usr/local/lib/magic-filter/lp.df and those queued by
  1327. `lpr' through /usr/local/lib/magic-filter/lp.lf.
  1328.  
  1329. See also the next question.
  1330.  
  1331.  
  1332.  XIV.08)  My /etc/printcap looks identical to someone else's but it
  1333. doesn't work - why?
  1334.  
  1335. ANSWER: See if lpc stat reports a printer called ` :'. The last
  1336. character on a continued line must be a \. If there are whitespace
  1337. characters after the \ then it doesn't register the next line as a
  1338. continuation.
  1339.  
  1340.  
  1341.  XIV.09)  What's the minimum /etc/printcap?
  1342.  
  1343. ANSWER: This is a silly question but it _is_ frequently asked. The
  1344. answer is ``lp:sh'' (that's 6 bytes including the linefeed character
  1345. on the end). To use this /etc/printcap you must make /dev/lp a symlink
  1346. to your printer and create your spool queue directory as
  1347. /usr/spool/lpd.  (You might think that if you wanted banner pages you
  1348. could loose the ``:sh'' but the termcap syntax requires at least one
  1349. charateristic per entry).
  1350.  
  1351.  
  1352.  XIV.10)  How do I prevent the `staircase effect'?
  1353.  
  1354. ANSWER: Unix terminates each line of a file with a linefeed but not a
  1355. carriage return so taken literally a Unix text file printed on an
  1356. ASCII device will start each line below the end of the previous line.
  1357. Some printers can be set to treat "linefeed" as "carriage return,
  1358. linefeed", others can't. If yours can then do simply do that. If the
  1359. printer cannot be fixed create a shell script filter that reads:
  1360.  
  1361. #!/bin/sh
  1362. if [ $1 = -c ]; then
  1363.   cat
  1364. else
  1365.   sed -e s/$/^M/
  1366. fi
  1367. echo -ne \\f
  1368.  
  1369. where ^M is a carriage return character not a ^ followed by a M.  To
  1370. type ^M in emacs use the sequence C-q C-m and in vi use C-v C-m.
  1371. Conventionally this script is called /usr/lib/lpf. The test of $1
  1372. allows the isertion of carriage returns to be switched off by the `-l'
  1373. switch on lpr.
  1374.  
  1375. Alternatively your printer may have an escape sequence that will set
  1376. the way it handles linefeed characters. A simple filter that uses an 
  1377. `echo -ne' command to send this sequence may be appropriate.
  1378.  
  1379. #!/bin/sh
  1380. # Filter for HP printers to treat LF as CRLF  
  1381. echo -ne \\033\&k2G
  1382. cat
  1383. echo -ne \\f
  1384.  
  1385. [ Ross Biro's new release will include a filter called lpof that does
  1386. this. ]
  1387.  
  1388.  
  1389.  XIV.11)  How do I get my printer to go back to the default font after
  1390. each printout?
  1391.  
  1392. ANSWER: Define the `tr' ``capability'' in /etc/printcap to be your
  1393. printer's font reset command. For details of the format of this string
  1394. see the question on the format of printcap. This may not work if a
  1395. printout crashes in the middle of an escape sequence - putting a lot
  1396. of ^@ on the front may help but this probably won't be enough it you
  1397. were printing raster graphics when the filter died.
  1398.  
  1399.  
  1400.  XIV.12)  How do I prevent a formfeed at the end of every printout?
  1401.  
  1402. ANSWER: If you don't have an `if' specified in /etc/printcap then lpd
  1403. will automatically put a formfeed at the end of each file. If you're
  1404. using a filter then it's up to the filter to decide if it wants to put
  1405. a formfeed. To disable formfeed completely if you don't have an `if'
  1406. put :ff=: in your /etc/printcap.  But please note this suppresses the
  1407. formfeed that would usually be printed if a filter dies. If you want
  1408. formfeeds after text printouts but not on printouts printed with `lpr
  1409. -l' then create the following `if' filter:
  1410.  
  1411. #!/bin/sh
  1412. cat
  1413. if [ "$1" != -c ]; then
  1414.   echo -ne \\f
  1415. fi
  1416.  
  1417. If you want a formfeed after `lpr -l' to be optional you can misuse the
  1418. `-i' switch to suppress the formfeed with the following trick (after
  1419. all `lpr -i -l' would usually not be implemented).
  1420.  
  1421. #!/bin/sh
  1422. cat
  1423. # use lpr -i -l to print raw without trailing formfeed
  1424. if [ "$1" != -c -o "$4" = -i0 ]; then 
  1425.   echo -ne \\f
  1426. fi 
  1427.  
  1428.  
  1429.  XIV.13)  How do I get burst/banner pages?
  1430.  
  1431. ANSWER: For a simple text printer (in particular not postscript) and a
  1432. simple text banner simply take :sh: out of the printcap record. If you
  1433. want to prevent the banner comming out in whatever font was last used
  1434. on the printer then define the `tr' ``capability'' to be your
  1435. printer's font reset command.
  1436.  
  1437. If you want a fancy cusomised banner (or have a postscript printer)
  1438. leave :sh: in the printcap and make each of your filters print the
  1439. banner. All the information to put on the banner is included in the
  1440. filter's positional parameters.  RTFM(printcap) for details. [ If
  1441. you're using <B.A.McCauley@bham.ac.uk>'s magic-filter package then
  1442. call the code to print the banners from the config script. ]
  1443.  
  1444.  
  1445.  XIV.14)  How do I print text on a ps printer?
  1446.  
  1447. ANSWER: You need a filter based on a program called enscript. I don't
  1448. know where you can get enscript for Linux.
  1449.  
  1450.  
  1451.  XIV.15)  Why do files with a lot of graphics get truncated?
  1452.  
  1453. ANSWER: Usually because you've got a limit set on the maximum size
  1454. file that can sit in the spool queue. Put `mx#0' in your printcap.
  1455.  
  1456.  
  1457.  XIV.16)  Why doesn't `lpr -i' work?
  1458.  
  1459. ANSWER: To get lpr -i to work you need a filter istalled as `if' that
  1460. implements it. The -i switch is simply passed on by lpd to the filter.
  1461. There is such a filter called /usr/lib/lpf that can be opdtained from
  1462. bsd source archives in the directory bsd-source/lpr/filters.
  1463.  
  1464.  
  1465.  XIV.17)  Why doesn't `lpr -p' work?
  1466.  
  1467. ANSWER: Because its broken in the '88 sources from which the old binaries were
  1468. compiled.  lpd always thinks that the printer is 0 characters wide
  1469. regardless of what printcap says.
  1470.  
  1471.  
  1472.  XIV.18)  Why does lprm say `too many users'?
  1473.  
  1474. ANSWER: This was a bug in the C library in the scandir() function which failed
  1475. when an unsorted directory list was requested. This has been fixed now
  1476. so just get a new libc.so. Alternatively there is a lprm with a
  1477. workround (by toy@soho.crd.ge.com) in:
  1478.  
  1479. sunsite.unc.edu:/pub/Linux/system/Daemons/lprm-fix.tar.z
  1480.  
  1481.  
  1482.  XIV.19)  Why does lpc complain that it hasn't stopped a daemon?
  1483.  
  1484. ANSWER: There's one lpd process that runs all the time and it spawns
  1485. off children to handle each printer as needed. These children leave
  1486. lock files lying about so lpc thinks that they are still running and
  1487. tries to kill them. This is probably a bug but it's not serious.
  1488.  
  1489.  
  1490.  XIV.20)  How do I print over a Network?
  1491.  
  1492. ANSWER: To print on the printer "foo" connected to the machine
  1493. "bar.baz.net" from the machine "mine.baz.net" you put an entry like
  1494. this in your /etc/printcap (on mine.baz.net):
  1495.  
  1496. foo:lp=:rm=bar.baz.net:rp=foo:sd=/usr/lpd/spool/foo:
  1497.  
  1498. and, of course, create the spool directory /usr/lpd/spool/foo.
  1499.  
  1500. There's no point specitying filters and the like in
  1501. mine.baz.net:/etc/printcap as it's the one in
  1502. bar.baz.net:/etc/printcap that will get used.
  1503.  
  1504. On the machine bar.baz.foo, you need to put "mine.baz.net" on a line
  1505. by itself in either /etc/hosts.equiv or /etc/hosts.lpd; note that
  1506. putting it in /etc/hosts.equiv will allow for unauthenticated logins as
  1507. well as printing.  /etc/hosts.lpd is printing only.
  1508.  
  1509. [ Editors note: I realise there are more questions about net printing
  1510. but I don't know them. If you find any let me know (with answers if
  1511. possible). See also the net FAQ ]
  1512.  
  1513.  
  1514.  XIV.21)  Which /dev/lp* is my printer?
  1515.  
  1516. ANSWER: On an XT bus system LPT1: becomes /dev/lp0 (major=6, minor=0),
  1517. on an AT LPT1: becomes /dev/lp1 (major=6, minor=1). To be more
  1518. precise:
  1519.  
  1520. Name Major Minor I/O address
  1521.  lp0   6     0       0x3bc
  1522.  lp1   6     1       0x378
  1523.  lp2   6     2       0x278
  1524.  
  1525.  
  1526.  XIV.22)  When the kernel boots it says `using polling driver,' is
  1527. there an interrupt driven driver?
  1528.  
  1529. ANSWER: Yes the latest kernels support parrallel port IRQs but to
  1530. enable them you must use `lpcntl'. The interrupt driver uses less
  1531. processor time and gives a faster throughput but sometimes one may
  1532. choose sacrifice this to free up an IRQ line. If your printer is
  1533. /dev/lp1 using IRQ 7 put:
  1534.  
  1535. /etc/lpcntl /dev/lp1 7
  1536.  
  1537. in your /etc/rc.
  1538.  
  1539. If you don't have lpcntl get it from:
  1540.  
  1541. tsx-11.mit.edu:/pub/Linux/BETA/lp/lpirq.4.tar.Z
  1542.  
  1543.  
  1544.  XIV.23)  What's the difference between the polling driver and an the
  1545. interrupt driven one?
  1546.  
  1547. ANSWER: A polling sits in a loop repeatedly reading the port hardware
  1548. to see if it is ready for another character and then gives it one. An
  1549. interrupt driver goes to sleep and is woken by the port hardware
  1550. (using a hardware interrupt) when it wants another character. Polling
  1551. drivers are easier to write but in multitasking environments they are
  1552. a bad thing.)
  1553.  
  1554.  
  1555.  XIV.24)  How do I write filters?
  1556.  
  1557. ANSWER: In normal Unix terminology, filters are just programs (so they
  1558. must have execute permission) that read a stream from their standard
  1559. input and write to their standard output.
  1560.  
  1561. lpd filters are filters in the sense that thay read from their STDIN
  1562. and write to their STDOUT but are not necessarily true filters in that
  1563. they may assume that their standard input is a file and perform
  1564. lseek() operations on it. I'm not sure that such filters are strictly
  1565. conforming but they seem to work OK.
  1566.  
  1567. All lpd filters must conform to a particular command line syntax (or
  1568. more often simply ignore command line parameters). For details of the
  1569. command line parameters RTFM(printcap).
  1570.  
  1571. It's easier to debug filters if you test them in an immediate shell
  1572. before you install them. (If your filter make use of its command line
  1573. arguments you'll have to specify them too).
  1574.  
  1575. my-new-filter <file >/dev/lp1
  1576.  
  1577. If you want to write a shell script filter it must have a #!/bin/sh
  1578. header.  Here for example is my Epson FX-80 dvi filter:
  1579.  
  1580. #!/bin/sh
  1581. /usr/TeX/bin/dvips -f | \
  1582. /usr/bin/gs -q -sDEVICE=eps9high -r120x216 -dNOPAUSE -sOutputFile=- -
  1583.  
  1584.  
  1585.  XIV.25)  I've written a filter in shell script which works OK when I
  1586. use it from the shell prompt but fails when I tell lpd to use it?
  1587.  
  1588. ANSWER: You may need a #!/bin/sh header. You may also need to set PATH
  1589. within the script since the daemon's PATH may not have everything you
  1590. need.
  1591.  
  1592.  
  1593.  XIV.26)  When should I define an `of' filter?
  1594.  
  1595. ANSWER: Never. (Well strictly speaking there are circumstances but
  1596. you're unlikey to meet them until you're so familar with lpd that you
  1597. won't need this FAQ.)
  1598.  
  1599.  
  1600.  XIV.27)  Where do I get filters for given printers?
  1601.  
  1602. ANSWER: From BSD source archives (I think). [Editors note: I need a
  1603. better answer here ].
  1604.  
  1605. If you already have a program to print say DVI on your printer then
  1606. making it into a filter is usually a matter of writting trivial shell
  1607. script - see this FAQ. If the program you are using insists on reading
  1608. a names file as input see the next question. Text mode filters are
  1609. trivial too (see this FAQ) unless you want lpr to have a choice of
  1610. fonts in which case they are slightly harder than trivial.  You will
  1611. probably want to insert and `echo -ne' command at the beginning and
  1612. end of your filter to set up the font etc to your liking.
  1613.  
  1614.  
  1615.  XIV.28)  How do I get a program that won't read from STDIN to act as
  1616. a filter?
  1617.  
  1618. ANSWER: For example dvilj2p insists on a named file as its input (and
  1619. what's more expects one with a .dvi suffix). To make a dvi filter for
  1620. a laserjet you'll have to capture the STDIN into a temporary file.
  1621.  
  1622. #!/bin/sh
  1623. cat >/tmp/$$.dvi
  1624. dvilj2p /tmp/$$
  1625. rm /tmp/$$.dvi
  1626.  
  1627. The problem with this kludge is that is may have a very high disk
  1628. overhead. (In the long term dvilj2p should be fixed).
  1629.  
  1630.  
  1631.  XIV.29)  The set of filters supported by lpd seem strange - why
  1632. aren't there filters for Postscript, GIF, TIFF and so on?
  1633.  
  1634. ANSWER: History. You can, in fact, use any of the filters (with the
  1635. possible exception of the default filter) for any reason. If you're
  1636. never going to use Benson Varian raster files you could use the -v
  1637. switch for GIF files. If you are on a network remember that the filter
  1638. setups go on the print server so you will need to consider other
  1639. people's needs too. To avoid running out of possible types use magic
  1640. filters.
  1641.  
  1642.  
  1643.  XIV.30)  What are magic filters?
  1644.  
  1645. ANSWER: Magic filters deduce their input files' types from `magic
  1646. numbers' (distictive byte patterns at particular offsets).  Magic
  1647. filters are usually perl scripts, shell scripts or C programs that
  1648. simply identify the file type then call the appropriate non-magic
  1649. filter. Blatent plug :-) I <B.A.McCauley@bham.ac.uk> have a generic
  1650. magic filter bash script that selects the right filter to use based on
  1651. the output of the `file' command. With my magic ``dvi'' filter (and
  1652. existing separate dvi and ps filters) I can do things like:
  1653.  
  1654. lpr -d file1.dvi file2.div.Z file3.ps file4.ps.z
  1655.  
  1656. This is not yet on any anon-ftp sites so e-mail me for a copy. Once
  1657. it's stable and I've had a bit of (possitive) feedback I'll upload it.
  1658.  
  1659. Magic filters should never specified as `of' as the output filter only
  1660. gets called once if a number of files are printed without a gap.
  1661.  
  1662. Magic filters as `if' can also be a problem as they may prevent you,
  1663. say, _listing_ a PostScript or nroff file.
  1664.  
  1665.  
  1666.        ===================8<==========>8================
  1667.  
  1668.  
  1669. -- 
  1670. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1671. #    LaBRI              |                        #
  1672. #  351 cours de la Liberation    |  e-mail:  corsini@geocub.greco-prog.fr   #
  1673. #  33405 Talence Cedex         |  e-mail:  corsini@labri.u-bordeaux.fr    #
  1674. #                   |                        #
  1675. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1676. -- 
  1677.      There will be a sig when our local net is reliable.
  1678.            For now, I would rather stay anonymous.
  1679.  
  1680.